package component;

import Main.Main;
import util.ImageUtils;

import javax.swing.*;
import java.awt.*;

/**
 * @author zhongwen
 * @description 模拟终端面板
 * @date 2021-12-25 11:28
 */
public class ConsolePane extends JPanel {
    private final JTextArea jTextArea = new JTextArea();
    private final JScrollPane scrollPane = new JScrollPane(jTextArea,  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    private final JLabel consoleLabel = new JLabel("模拟终端", new ImageIcon(ImageUtils.getImage("Console.png",24,24)), SwingConstants.LEFT);
    public ConsolePane(){
        jTextArea.setFont(Main.configurationBean.getFont());
        this.setLayout(new BorderLayout());
        this.add(consoleLabel,BorderLayout.NORTH);
        this.add(scrollPane, BorderLayout.CENTER);
    }

    public JTextArea getjTextArea(){
        return jTextArea;
    }

}
